import { getToken, removeToken, setToken } from '@/utils/storage'
const state = {
  token: getToken()
}

const mutations = {
  setToken(state, payload) {
    state.token = payload
    setToken(payload)
  },
  removeToken(state) {
    state.token = {}
    removeToken()
  }
}

const getters = {}
const actions = {}

export default {
  namespaced: true,
  state,
  mutations,
  getters,
  actions
}
